
from Schedule.Doctors import Doctors
from Schedule.ServiceType import ServiceType
from Schedule.AggregateCall import AggregateCall

class CommandLine():
    def __init__(self):
        pass

    @staticmethod
    def info(log_string):
        print log_string

    @staticmethod
    def printDoctorCounts(list):
        s = ""
        
        for doctor in list.keys():
            if list[doctor] > 0:
                s += Doctors().doctorNames[doctor] + ": " + str(list[doctor]) + ", "
            
        return s     
    
    @staticmethod
    def printIndividual(chromosome, schedule):
        '''
        prints out chromosome to console
        '''
        
        dayOfMonth = 0
        index = 0
        
        for shiftsInDay in schedule:
            dayOfMonth += 1
            output = "Day: %02d " % (dayOfMonth)
            
            for shiftIndex in range(shiftsInDay):
                doctor = chromosome[index]
                # output += "(%d) %s: %s%s" % (index, self._serviceType[shiftIndex], self._doctorNames[doctor], "\t" * (2 - len(self._doctorNames[doctor]) // 8))
                output += "%s: %s\t" % (ServiceType().serviceType[shiftIndex], Doctors().doctorNames[doctor])
                index += 1
                
            print output
            
        return  
    
    @staticmethod
    def printCall(tally):
        a = AggregateCall(True)
        map(a.mapDoctor, tally)         
        
        
if __name__ == "__main__":
    c = CommandLine()
    